package com.openbravo.data.loader.dialect.H2;

import com.openbravo.data.loader.I_Session;
import com.openbravo.data.loader.dialect.AbstractDBDialect;
import com.openbravo.data.loader.dialect.AbstractDDLFactory;
import com.openbravo.data.loader.sentence.SentenceFind;
import com.openbravo.data.loader.sentence.StaticSentence;
import com.openbravo.data.loader.serialize.serializer.read.SerializerReadInteger;

public class H2DBDialect extends AbstractDBDialect {
    public String TRUE() {
        return "TRUE";
    }

    public String FALSE() {
        return "FALSE";
    }

    public String INTEGER_NULL() {
        return "CAST(NULL AS UNSIGNED INTEGER)";
    }

    public String CHAR_NULL() {
        return "CAST(NULL AS CHAR)";
    }

    public String getName() {
        return "MySQL";
    }

    public SentenceFind getSequenceSentence(I_Session s, String sequence) {
        return new StaticSentence(s, "CALL NEXT VALUE FOR " + sequence, null, SerializerReadInteger.INSTANCE);
    }

    @Override
    public AbstractDDLFactory createDDLFactory() {
        return new H2DDLFactory(this);
    }
}
